<template>
  <div class="car-list">
    <scroll class="content" ref="scroll">
      <cart-list-item v-for="(item,i) in cartList" :key="i" :item-info="item"></cart-list-item>
    </scroll>
  </div>
</template>

<script>
import Scroll from "components/common/scroll/Scroll";
// 每一个item就是一个商品 封装起来的  组件化开发
import CartListItem from "./CarListItem";
//通过veux拿到数据 不是直接传递了
import { mapGetters } from "vuex";
export default {
  components: {
    Scroll,
    CartListItem,
  },
  computed: {
    ...mapGetters(["cartList"]),
  },
  //活跃状态
  activated() {
      this.$refs.scroll.refresh()
  }
};
</script>

<style scoped>
.cart-list {
  height: calc(100% - 44px - 49px - 40px);
}
.content {
  height: 100%;
  overflow: hidden;
}
</style>